/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.subway.persistencias;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Héctor <UFG>
 */
@Entity
@Table(name = "prod_entrega", catalog = "bd_subway", schema = "")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "ProdEntrega.findAll", query = "SELECT p FROM ProdEntrega p"),
    @NamedQuery(name = "ProdEntrega.findByEntPId", query = "SELECT p FROM ProdEntrega p WHERE p.entPId = :entPId"),
    @NamedQuery(name = "ProdEntrega.findByEntPFecha", query = "SELECT p FROM ProdEntrega p WHERE p.entPFecha = :entPFecha")})
public class ProdEntrega implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "entPId")
    private Integer entPId;
    @Basic(optional = false)
    @NotNull
    @Column(name = "entPFecha", nullable = false)
    @Temporal(TemporalType.TIMESTAMP)
    private Date entPFecha;
    @JoinColumn(name = "entPEmpleadoId", referencedColumnName = "empId", nullable = false)
    @ManyToOne(optional = false)
    private Empleado entPEmpleadoId;
    @JoinColumn(name = "entPCategoriaPId", referencedColumnName = "catId", nullable = false)
    @ManyToOne(optional = false)
    private ProdCategoria entPCategoriaPId;

    public ProdEntrega() {
    }

    public ProdEntrega(Integer entPId) {
        this.entPId = entPId;
    }

    public ProdEntrega(Integer entPId, Date entPFecha) {
        this.entPId = entPId;
        this.entPFecha = entPFecha;
    }

    public Integer getEntPId() {
        return entPId;
    }

    public void setEntPId(Integer entPId) {
        this.entPId = entPId;
    }

    public Date getEntPFecha() {
        return entPFecha;
    }

    public void setEntPFecha(Date entPFecha) {
        this.entPFecha = entPFecha;
    }

    public Empleado getEntPEmpleadoId() {
        return entPEmpleadoId;
    }

    public void setEntPEmpleadoId(Empleado entPEmpleadoId) {
        this.entPEmpleadoId = entPEmpleadoId;
    }

    public ProdCategoria getEntPCategoriaPId() {
        return entPCategoriaPId;
    }

    public void setEntPCategoriaPId(ProdCategoria entPCategoriaPId) {
        this.entPCategoriaPId = entPCategoriaPId;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (entPId != null ? entPId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof ProdEntrega)) {
            return false;
        }
        ProdEntrega other = (ProdEntrega) object;
        if ((this.entPId == null && other.entPId != null) || (this.entPId != null && !this.entPId.equals(other.entPId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "org.subway.persistencias.ProdEntrega[ entPId=" + entPId + " ]";
    }
    
}
